//定义一个数值和字符串的联合类型
let newarr: number | string = 1

//定义一个类型断言
let someValue: any = "this is a string"
let strLength: number = (someValue as string).length;

const NUM = "12" as string
type STR = typeof NUM
let nwestr: STR = "34"